﻿using Freshbox2._0.BLL;
using Freshbox2._0.MODEL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Freshbox2._0.UI.Controllers
{
    public class JoinBusinessController : BaseController<franchisee >
    {
        //
        // GET: /JoinBusiness/ 


        public override BLL.BaseBll<franchisee> bll
        {
            get
            {
                return new JoinBusinessBll();
            }

        }
        // franchiseeid   franchiseename  franchiseephone  franchiseeemail  franchiseeadress
        public override ActionResult Get(int page, int rows, franchisee model)
        {
            int count;
            var list = bll.Search(model, x => true, true, x => x.franchiseeid, rows, page, out count).ToList().Select(x => new
            {
                x.franchiseeid,
                x.franchiseename,
                x.franchiseephone,
                x.franchiseeemail,
                x.franchiseeadress,
            }).ToList();
            return Json(new { total = count, rows = list });
        }


    }
}
